package com.ruoyi.common.context;

import com.ruoyi.common.vo.AppUser;

public class AppUserContext {

    private static final ThreadLocal<AppUser> appUserThreadLocal = new ThreadLocal<>();

    public static void setUser(AppUser appUser) {
        appUserThreadLocal.set(appUser);
    }

    public static AppUser getUser() {
        return appUserThreadLocal.get();
    }

    public static void clear() {
        appUserThreadLocal.remove();
    }

}
